import React, { forwardRef, useContext } from "react"
import { MenuItemProps } from "./interface"
import { MenuContext } from "./context"
import { cs } from "../../utils"
function MenuItemComponent(props: MenuItemProps, ref) {
    const { prefixCls } = useContext(MenuContext)
    const { children, ...rest } = props
    const classNames = cs(`${prefixCls}-children`)
    return (
        <div ref={ref} {...rest} className={classNames}>
            {children}
        </div>
    )
}
const MenuItem = forwardRef<unknown, MenuItemProps>(MenuItemComponent)
MenuItem.displayName = "MenuItem"
export default MenuItem